import type { PatientItem, PatientParams } from '@/types/patient'
import { request } from '@/utils/request'


/**
 * 添加患者（家庭档案）
 */
export const addPatientApi = (data: PatientParams) => {
  return request.post('/patient/add', data)
}
/**
 * 获取患者（家庭档案）列表
 */
export const patientListApi = () => {
  return request.get<null, PatientItem[]>('/patient/mylist')
}
// 问诊-删除患者信息
// DELETE
// /patient/del/{id}
export const delPatientApi = (id: string) => {
  return request.delete(`/patient/del/${id}`)
}
//问诊-查询患者详情
// GET
// /patient/info/{id}
export const patientInfoApi = (id: string) => {
  return request.get<null, PatientItem>(`/patient/info/${id}`)
}
// 问诊-编辑患者信息
// PUT
// /patient/update
export const updatePatientApi = (data: PatientParams) => {
  return request.put('/patient/update', data)
}